using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using BUS;
using Utility;
using Entities;

public partial class Admin_Suahinhthucthanhtoan : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadData();
        }

    }
    protected void btn_sua_Click(object sender, EventArgs e)
    {
        //try
        //{
        int id = int.Parse(Request.QueryString["id"].ToString());
        tbHinhthucthanhtoan  httt = tbHinhthucttBUS .GetByID(id);

        httt.Tenhinhthuctt  = txt_tenhttt.Text;
        tbHinhthucttBUS .Update(httt);

        //catch
        //{
        Response.Redirect("~/Admin/DShinhthucthanhtoan.aspx");
        //}
    }
    private void LoadData()
    {
        try
        {
            int id = int.Parse(Request.QueryString["id"].ToString());
            txt_mahttt.Text = id.ToString();

            tbHinhthucthanhtoan  httt= tbHinhthucttBUS .GetByID(id);
            txt_tenhttt.Text = httt .Tenhinhthuctt ;
        }
        catch
        {
            Response.Redirect("~/Admin/DShinhthucthanhtoan.aspx");
        }
    }
}
